#pragma once

#include <functional>

#include "Control_TextHover.h"

namespace gui
{
	class Control_CheckBox : public Control_TextHover
	{
	public:
		typedef std::function< bool() > CallbackGetBoolValue;
		typedef std::function< void(bool) > CallbackSetBoolValue;

		Control_CheckBox(CallbackGetBoolValue NewCallbackGetValue, CallbackSetBoolValue NewCallbackSetValue, std::string NewCaption, Vec<2, float> NewFontSize, ColorRGBA<unsigned char> NewForeColor, ColorRGBA<unsigned char> NewColorBack1, ColorRGBA<unsigned char> NewColorBack2, ColorRGBA<unsigned char> NewColorFalse, ColorRGBA<unsigned char> NewColorTrue, Vec<2, float> NewPos, Vec<2, float> NewSize, Control_Menu* NewParentMenu, Host& NewParentHost);
		virtual ~Control_CheckBox();

	protected:
		virtual void Refresh();
		virtual void MouseDownLeft();

		virtual void UpdateVerticesFix(RendererComponent& Renderer);
		//virtual void UpdateVerticesSlow(Renderer& Ren){}


	private:
		bool Value;
		bool LastValue;

		ColorRGBA<unsigned char> ColorTrue;
		ColorRGBA<unsigned char> ColorFalse;

		CallbackGetBoolValue CallbackGetValue;
		CallbackSetBoolValue CallbackSetValue;
	};
};